package com.cp.sms.controller.api;

import com.cp.common.result.R;
import com.cp.sms.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ming
 * @create 2022/7/29
 * @description:
 */
//@CrossOrigin
@RequestMapping("/api/sms")
@Api(tags = "短信管理")
@Slf4j
@RestController
public class ApiSmsController {
    @Resource
    private SmsService smsService;
    @ApiOperation("短信发送")
    @GetMapping("/send/{mobile}")
    public R send(@PathVariable String mobile ){
        smsService.send(mobile);
        return R.ok().message("短信发送成功");
    }
}
